﻿<%@ Page Title="Editar" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<amk.ViewModels.CadastroEditarViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">Editar</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% using (Html.BeginForm("Editar", "Cadastro", FormMethod.Post, new { id = "formCadastro" }))
       {%>
       
       
        <%: Html.ValidationSummary(true) %>

       
        
        <fieldset>
           <%: Html.HiddenFor(model => model.Cadastro.SEQ_CADASTRO) %>
            <legend>Alteração de Cadastro</legend>

            <fieldset title="Cadastro">
              <legend>Cadastro</legend>
              <div>
                <div>
                  Data<br />
                  <%: String.Format("{0:dd/MM/yyyy}", Model.Cadastro.DAT_CADASTRO) %>
                </div>
                <div>
                    <%: Html.LabelFor(model => model.Cadastro.DSC_SITUACAO_CADASTRO)%><br />
                    <%: Html.DropDownListFor(model => model.Cadastro.DSC_SITUACAO_CADASTRO, new[]{
                            new SelectListItem{Text="Ativo", Value="A"},              
                            new SelectListItem{Text="Inativo", Value="I"},              
                            new SelectListItem{Text="Suspenso", Value="S"},
                            new SelectListItem{Text="Cancelado", Value="C"}})%>
                    <%: Html.ValidationMessageFor(model  => model.Cadastro.DSC_SITUACAO_CADASTRO)%>
                </div>
              </div>
            </fieldset>

            <fieldset title="Academia">
              <legend>Academia</legend>
                <div>
                  <div>
                      <%: Html.LabelFor(model  => model.Cadastro.SEQ_ACADEMIA) %><br />
                      <%: Html.DropDownListFor(model => model.Cadastro.SEQ_ACADEMIA, new SelectList(Model.Academia, "SEQ_ACADEMIA", "NOM_ACADEMIA"))%>
                      <%: Html.ValidationMessageFor(model  => model.Cadastro.SEQ_ACADEMIA)%>
                  </div>
                  <div>
                    <%: Html.LabelFor(model =>model.Cadastro.FLG_CONTATO_ACADEMIA) %><br />
                    <%: Html.CheckBoxFor(model  => model.Cadastro.FLG_CONTATO_ACADEMIA) %>
                    <%: Html.ValidationMessageFor(model  => model.Cadastro.FLG_CONTATO_ACADEMIA) %>
                  </div>
                </div>
            </fieldset>

            <fieldset title="Graduação">
              <legend>Graduação</legend>
                <table id="tabelaGraduacao" summary="Histórico de Graduações">
                  <caption>Histórico de Graduações</caption>
                  <thead>
                    <tr>
                      <th>Graduação</th>
                      <th>Data</th>
                    </tr>
                  </thead>

                  <tbody>
                    <% foreach (var graduacao in Model.CadastroGraduacao) { %>
                        <tr>
                          <td><%: graduacao.GRADUACAO.NOM_GRADUACAO %></td>
                          <td><%: String.Format("{0:dd/MM/yyyy}", graduacao.DAT_GRADUACAO)%></td>
                        </tr>                       
                     <% } %>
                  </tbody>

                </table>
                <div>
                    <%: Html.LabelFor(model  => model.Graduacao) %><br />
                    <%: Html.DropDownListFor(model => model.Graduacao, new SelectList(Model.Graduacao, "SEQ_GRADUACAO", "NOM_GRADUACAO"))%>
                    <%: Html.ValidationMessageFor(model  => model.Cadastro.SEQ_ACADEMIA)%>
                </div>
            </fieldset>


            <fieldset title="Cadastro CBK">
              <legend>Cadastro CBK</legend>
                <div>
                  <div>
                    <%: Html.LabelFor(model =>model.Cadastro.FLG_CADASTRO_CBK) %><br />
                    <%: Html.CheckBoxFor(model => model.Cadastro.FLG_CADASTRO_CBK)%>
                    <%: Html.ValidationMessageFor(model => model.Cadastro.FLG_CADASTRO_CBK)%>
                  </div>
                  <div>
                    <%: Html.LabelFor(model => model.Cadastro.DAT_CADASTRO_CBK) %><br />
                    <%: Html.TextBoxFor(model => model.Cadastro.DAT_CADASTRO_CBK, new { size = "10", maxlength = "10" })%>
                    <%: Html.ValidationMessageFor(model => model.Cadastro.DAT_CADASTRO_CBK) %>
                  </div>
                  <div>
                    <%: Html.LabelFor(model => model.Cadastro.DSC_SITUACAO_CADASTRO_CBK) %><br />
                    <%: Html.DropDownListFor(model => model.Cadastro.DSC_SITUACAO_CADASTRO_CBK, new[]{
                            new SelectListItem{Text="Ativo", Value="A"},              
                            new SelectListItem{Text="Inativo", Value="I"},              
                            new SelectListItem{Text="Suspenso", Value="S"},
                            new SelectListItem{Text="Cancelado", Value="C"}})%>
                    <%: Html.ValidationMessageFor(model  => model.Cadastro.DSC_SITUACAO_CADASTRO_CBK)%>
                  </div>
                </div>
            </fieldset>

            <fieldset title="Dados Pessoais">
              
              <legend>Dados Pessoais</legend>
              <div>
                  <%: Html.LabelFor(model => model.Cadastro.DSC_NOME)%><br />
                  <%: Html.TextBoxFor(model => model.Cadastro.DSC_NOME, new { size = "100", maxlength = "250" })%>
                  <%: Html.ValidationMessageFor(model => model.Cadastro.DSC_NOME) %>
              </div>
              <div>
                  <%: Html.LabelFor(model => model.Cadastro.DAT_NASCIMENTO)%><br />
                  <%: Html.TextBoxFor(model => model.Cadastro.DAT_NASCIMENTO, new { size = "10", maxlength = "10" })%>
                  <%: Html.ValidationMessageFor(model => model.Cadastro.DAT_NASCIMENTO)%>
              </div>
              <div>
                  <%: Html.LabelFor(model => model.Cadastro.NUM_IDENTIDADE)%><br />
                  <%: Html.TextBoxFor(model => model.Cadastro.NUM_IDENTIDADE, new { size = "20", maxlength = "20" })%>
                  <%: Html.ValidationMessageFor(model => model.Cadastro.NUM_IDENTIDADE)%>
              </div>
              <div>
                  <%: Html.LabelFor(model  => model.Cadastro.NUM_CPF)%><br />
                  <%: Html.TextBoxFor(model  => model.Cadastro.NUM_CPF, new { size = "14", maxlength = "14" })%>
                  <%: Html.ValidationMessageFor(model  => model.Cadastro.NUM_CPF)%>
              </div>
            </fieldset>

            <fieldset title="Endereço completo">
                <legend>Endereço completo</legend>
                <div>
                    <%: Html.LabelFor(model  => model.Cadastro.DSC_ENDERECO) %><br />
                    <%: Html.TextBoxFor(model  => model.Cadastro.DSC_ENDERECO, new { size = "60", maxlength = "250" })%>
                    <%: Html.ValidationMessageFor(model  => model.Cadastro.DSC_ENDERECO) %>
                </div>
            
                <div>
                    <%: Html.LabelFor(model  => model.Cadastro.NOM_BAIRRO) %><br />
                    <%: Html.TextBoxFor(model  => model.Cadastro.NOM_BAIRRO, new { size = "40", maxlength = "250" }) %>
                    <%: Html.ValidationMessageFor(model  => model.Cadastro.NOM_BAIRRO) %>
                </div>
            
                <div>
                  <div>
                      <%: Html.LabelFor(model => model.Cadastro.NOM_CIDADE) %><br />
                      <%: Html.TextBoxFor(model => model.Cadastro.NOM_CIDADE, new { size = "40", maxlength = "250" }) %>
                      <%: Html.ValidationMessageFor(model  => model.Cadastro.NOM_CIDADE) %>
                  </div>
            
                  <div>
                      <%: Html.LabelFor(model => model.Cadastro.SEQ_UF) %><br />
                      <%: Html.DropDownListFor(model => model.Cadastro.SEQ_UF, new SelectList(Model.Uf, "SEQ_UF", "SIG_UF")) %>
                      <%: Html.ValidationMessageFor(model => model.Cadastro.SEQ_UF) %>
                  </div>
                </div>
            
                <div>
                    <%: Html.LabelFor(model => model.Cadastro.NUM_CEP) %><br />
                    <%: Html.TextBoxFor(model => model.Cadastro.NUM_CEP, new { size = "9", maxlength = "9" }) %>
                    <%: Html.ValidationMessageFor(model => model.Cadastro.NUM_CEP) %>
                </div>
            </fieldset>

            <fieldset title="E-Mail">
              <legend>E-Mail</legend>
              <div>
                <%: Html.LabelFor(model => model.Cadastro.DSC_EMAIL) %><br />
                <%: Html.TextBoxFor(model => model.Cadastro.DSC_EMAIL, new { size="50", maxlength="200" }) %>
                <%: Html.ValidationMessageFor(model => model.Cadastro.DSC_EMAIL)%>
              </div>
            </fieldset>

            <fieldset title="Responsáveis">
              <legend>Resposáveis</legend>
              <div>
                <div>
                  <%: Html.LabelFor(model => model.Cadastro.NOM_PAI) %><br />
                  <%: Html.TextBoxFor(model => model.Cadastro.NOM_PAI, new{ size = "50", maxlength = "250" }) %>
                  <%: Html.ValidationMessageFor(model => model.Cadastro.NOM_PAI)%>
                </div>
                <div>
                  <%: Html.LabelFor(model => model.Cadastro.NOM_MAE) %><br />
                  <%: Html.TextBoxFor(model => model.Cadastro.NOM_MAE, new { size = "50", maxlength = "250" })%>
                  <%: Html.ValidationMessageFor(model => model.Cadastro.NOM_MAE)%>
                </div>
              </div>
            </fieldset>

            <fieldset title="Telefones de Contato">
              <legend>Telefones de Contato</legend>
              <div>
                <div>
                  <%: Html.LabelFor(model => model.Cadastro.NUM_TELEFONE_CASA) %><br />
                  <%:Html.TextBoxFor(model => model.Cadastro.NUM_TELEFONE_CASA, new { size="13", maxlength = "13" })%>
                  <%:Html.ValidationMessageFor(model => model.Cadastro.NUM_TELEFONE_CASA) %>
                </div>
                <div>
                  <%: Html.LabelFor(model => model.Cadastro.NUM_TELEFONE_CELULAR) %><br />
                  <%:Html.TextBoxFor(model => model.Cadastro.NUM_TELEFONE_CELULAR, new { size = "13", maxlength = "13" })%>
                  <%:Html.ValidationMessageFor(model => model.Cadastro.NUM_TELEFONE_CELULAR)%>
                </div>
              </div>
              <div>
                <div>
                  <%: Html.LabelFor(model => model.Cadastro.NUM_TELEFONE_TRABALHO) %><br />
                  <%:Html.TextBoxFor(model => model.Cadastro.NUM_TELEFONE_TRABALHO, new { size = "13", maxlength = "13" })%>
                  <%:Html.ValidationMessageFor(model => model.Cadastro.NUM_TELEFONE_TRABALHO)%>
                </div>
                <div>
                  <%: Html.LabelFor(model => model.Cadastro.NUM_TELEFONE_FAX) %><br />
                  <%:Html.TextBoxFor(model => model.Cadastro.NUM_TELEFONE_FAX, new { size = "13", maxlength = "13" })%>
                  <%:Html.ValidationMessageFor(model => model.Cadastro.NUM_TELEFONE_FAX)%>
                </div>
              </div>
            </fieldset>

            <fieldset title="Observações">
              <legend>Observações</legend>
              <div>
                <%: Html.LabelFor(model => model.Cadastro.DSC_OBSERVACAO)%><br />
                <%: Html.TextArea("DSC_OBSERVACAO", Server.HtmlDecode(Model.Cadastro.DSC_OBSERVACAO))%>
                <%: Html.ValidationMessageFor(model => model.Cadastro.DSC_OBSERVACAO)%>
              </div>
            </fieldset>


            <p>
              <input type="submit" value="Alterar" class="btGravar" />
              <input type="reset" value="Cancelar" class="btCancelar" />
            </p>

        </fieldset>
  

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

